/**
 * Demonstrates a range of Button options the framework offers out of the box
 */
Ext.define('cloud.view.spot.SpotEdit', {
    extend: 'Ext.form.FormPanel',
    xtype: 'spotedit',

    requires: ['Ext.form.Panel', 'Ext.form.FieldSet', 'Ext.field.Hidden', 'Ext.ux.Fileup', 'Ext.Img'],
    config: {
        //style:'font-size:14px',
        title: '更新景区',
        items: [
            {
                xtype: 'toolbar',
                docked: 'bottom',
                layout: {
                    type: 'hbox',
                    pack: 'end'
                },
                items: [
                    {
                        xtype: 'hiddenfield',
                        name: 'spot_id',
                        id: 'spot_id'
                    },
                    {
                        id: 'spot_edit_submit',
                        iconMask: true,
                        scope: this,
                        cls: 'x-button2',
                        text: '更新',
                        style: 'float:right'
                    },
                    {
                        id: 'spot_del',
                        iconMask: true,
                        scope: this,
                        cls: 'x-button2',
                        text: '删除',
                        style: 'float:right'
                    }
                ]
            },
            {
                xtype: 'fieldset',
                title: '更新',
                defaults: {
                    labelwidth: '20%',
                    xtype: 'textfield',
                    required: true,
                    clearIcon: true
                },
                items: [
                    {
                        name: 'name',
                        label: '景区列表',
                        maxLength: 50,
                        placeHolder: '请输景区列表'
                    },
                    {
                        xtype: 'textareafield',
                        name: 'explain',
                        label: '景点介绍',
                        placeHolder: '景点介绍',
                        required: true,
                        clearIcon: false
                    },
                    {   xtype: 'selectfield',
                        name: 'display',
                        label: '排序',
                        options: [
                            {text: '1', value: '1'},
                            {text: '2', value: '2'},
                            {text: '3', value: '3'},
                            {text: '4', value: '4'},
                            {text: '5', value: '5'},
                            {text: '6', value: '6'},
                            {text: '7', value: '7'},
                            {text: '8', value: '8'},
                            {text: '9', value: '9'},
                            {text: '10', value: '10'}
                        ]

                    }
                ]
            },
            {
                layout: 'hbox',
                xtype: 'panel',
                style: 'margin:0 40px;',
                items: [
                    {
                        itemId: 'spot_upload_icon',
                        xtype: 'fileupload',
                        width: '20%',
                        height: '10px',
                        autoUpload: true,
                        loadAsDataUrl: true,
                        states: {
                            browse: {
                                text: '未签到图片'
                            },
                            ready: {
                                text: 'Load'
                            },

                            uploading: {
                                text: 'Loading',
                                loading: true
                            }
                        }
                    },

                    {
                        itemId: 'loadedImage',
                        id: 'spot_loadedImage',
                        xtype: 'img',
                        width: '80%',
                        height: '200px',
                        style: 'margin-top:15px;'
                    }
                ]
            },
            {
                layout: 'hbox',
                xtype: 'panel',
                style: 'margin:0 40px;',
                items: [
                    {
                        itemId: 'spotsign_upload_icon',
                        xtype: 'fileupload',
                        width: '20%',
                        height: '10px',
                        autoUpload: true,
                        loadAsDataUrl: true,
                        states: {
                            browse: {
                                text: '已签到图片'
                            },
                            ready: {
                                text: 'Load'
                            },

                            uploading: {
                                text: 'Loading',
                                loading: true
                            }
                        }
                    },

                    {
                        itemId: 'signloadedImage',
                        id: 'spotsign_loadedImage',
                        xtype: 'img',
                        width: '80%',
                        height: '200px',
                        style: 'margin-top:15px;'
                    }

                ]
            }
        ]
    }
});